home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / itcl1_31.z / itcl1_31 / tcldev / itcl-1.3 / configure < prev    next >
Encoding:
Text File  |  1993-10-15  |  21.4 KB  |  834 lines

  1.  
  2. #!/bin/sh
  3. # Guess values for system-dependent variables and create Makefiles.
  4. # Generated automatically using autoconf.
  5. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11.  
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16.  
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  22. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  23. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  24. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  53.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  54.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  55.     next_prefix=yes ;;
  56.  
  57.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  58.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  59.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  60.     next_srcdir=yes ;;
  61.  
  62.      -with-* | --with-*)
  63.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  64.        # Reject names that aren't valid shell variable names.
  65.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  66.          echo "configure: $package: invalid package name" >&2; exit 1
  67.        fi
  68.        package=`echo $package| sed 's/-/_/g'`
  69.        case "$arg" in
  70.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  71.          *) val=1 ;;
  72.        esac
  73.        eval "with_$package='$val'" ;;
  74.  
  75.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  76.        verbose=yes ;;
  77.  
  78.      *) ;;
  79.     esac
  80.   fi
  81. done
  82.  
  83. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  84. trap 'rm -f confdefs*' 0
  85.  
  86. # NLS nuisances.
  87. # These must not be set unconditionally because not all systems understand
  88. # e.g. LANG=C (notably SCO).
  89. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  90. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  91.  
  92. rm -f conftest* confdefs.h
  93. > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=src/itcl_core.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. # Make sure to not get the incompatible SysV /etc/install and
  133. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  134. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  135. # or the AFS install, which mishandles nonexistent args, or
  136. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  137. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  138. # anyway.  Sigh.
  139. if test "z${INSTALL}" = "z" ; then
  140.   echo checking for install
  141.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  142.   for dir in $PATH; do
  143.     test -z "$dir" && dir=.
  144.     case $dir in
  145.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  146.     *)
  147.       if test -f $dir/installbsd; then
  148.     INSTALL="$dir/installbsd -c" # OSF1
  149.     INSTALL_PROGRAM='$(INSTALL)'
  150.     INSTALL_DATA='$(INSTALL) -m 644'
  151.     break
  152.       fi
  153.       if test -f $dir/install; then
  154.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  155.       : # AIX
  156.     else
  157.       INSTALL="$dir/install -c"
  158.       INSTALL_PROGRAM='$(INSTALL)'
  159.       INSTALL_DATA='$(INSTALL) -m 644'
  160.       break
  161.     fi
  162.       fi
  163.       ;;
  164.     esac
  165.   done
  166.   IFS="$saveifs"
  167. fi
  168. INSTALL=${INSTALL-cp}
  169. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  170. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  171. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  172. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  173. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  174.  
  175. if test -z "$RANLIB"; then
  176.   # Extract the first word of `ranlib', so it can be a program name with args.
  177.   set dummy ranlib; word=$2
  178.   echo checking for $word
  179.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  180.   for dir in $PATH; do
  181.     test -z "$dir" && dir=.
  182.     if test -f $dir/$word; then
  183.       RANLIB="ranlib"
  184.       break
  185.     fi
  186.   done
  187.   IFS="$saveifs"
  188. fi
  189. test -z "$RANLIB" && RANLIB=":"
  190. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  191.  
  192. echo checking how to run the C preprocessor
  193. if test -z "$CPP"; then
  194.   # This must be in double quotes, not single quotes, because CPP may get
  195.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  196.   # make.  It must be expanded now.
  197.   CPP="${CC-cc} -E"
  198.   cat > conftest.c <<EOF
  199. #include "confdefs.h"
  200. #include <stdio.h>
  201. Syntax Error
  202. EOF
  203. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  204. if test -z "$err"; then
  205.   :
  206. else
  207.   rm -rf conftest*
  208.   CPP=/lib/cpp
  209. fi
  210. rm -f conftest*
  211. fi
  212. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  213.  
  214.  
  215. CC=${CC-cc}
  216.  
  217.  
  218. #--------------------------------------------------------------------
  219. #    Check for various typedefs and provide substitutes if
  220. #    they don't exist.
  221. #--------------------------------------------------------------------
  222.  
  223. echo checking for mode_t in sys/types.h
  224. echo '#include "confdefs.h"
  225. #include <sys/types.h>' > conftest.c
  226. eval "$CPP conftest.c > conftest.out 2>&1"
  227. if egrep "mode_t" conftest.out >/dev/null 2>&1; then
  228.   :
  229. else
  230.   rm -rf conftest*
  231.   
  232. {
  233. test -n "$verbose" && \
  234. echo "    defining" mode_t to be int
  235. echo "#define" mode_t int >> confdefs.h
  236. DEFS="$DEFS -Dmode_t=int"
  237. }
  238.  
  239. fi
  240. rm -f conftest*
  241.  
  242. echo checking for pid_t in sys/types.h
  243. echo '#include "confdefs.h"
  244. #include <sys/types.h>' > conftest.c
  245. eval "$CPP conftest.c > conftest.out 2>&1"
  246. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  247.   :
  248. else
  249.   rm -rf conftest*
  250.   
  251. {
  252. test -n "$verbose" && \
  253. echo "    defining" pid_t to be int
  254. echo "#define" pid_t int >> confdefs.h
  255. DEFS="$DEFS -Dpid_t=int"
  256. }
  257.  
  258. fi
  259. rm -f conftest*
  260.  
  261. echo checking for size_t in sys/types.h
  262. echo '#include "confdefs.h"
  263. #include <sys/types.h>' > conftest.c
  264. eval "$CPP conftest.c > conftest.out 2>&1"
  265. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  266.   :
  267. else
  268.   rm -rf conftest*
  269.   
  270. {
  271. test -n "$verbose" && \
  272. echo "    defining" size_t to be unsigned
  273. echo "#define" size_t unsigned >> confdefs.h
  274. DEFS="$DEFS -Dsize_t=unsigned"
  275. }
  276.  
  277. fi
  278. rm -f conftest*
  279.  
  280. echo checking for uid_t in sys/types.h
  281. echo '#include "confdefs.h"
  282. #include <sys/types.h>' > conftest.c
  283. eval "$CPP conftest.c > conftest.out 2>&1"
  284. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  285.   :
  286. else
  287.   rm -rf conftest*
  288.   
  289. {
  290. test -n "$verbose" && \
  291. echo "    defining" uid_t to be int
  292. echo "#define" uid_t int >> confdefs.h
  293. DEFS="$DEFS -Duid_t=int"
  294. }
  295.  
  296. {
  297. test -n "$verbose" && \
  298. echo "    defining" gid_t to be int
  299. echo "#define" gid_t int >> confdefs.h
  300. DEFS="$DEFS -Dgid_t=int"
  301. }
  302.  
  303. fi
  304. rm -f conftest*
  305.  
  306.  
  307. #--------------------------------------------------------------------
  308. #    Locate the X11 header files and the X11 library archive.  Try
  309. #    the ac_find_x macro first, but if it doesn't find the X stuff
  310. #    (e.g. because there's no xmkmf program) then check through
  311. #    a list of possible directories.
  312. #--------------------------------------------------------------------
  313.  
  314. if test -z "$tk_ok"; then
  315.   # Extract the first word of `xmkmf', so it can be a program name with args.
  316.   set dummy xmkmf; word=$2
  317.   echo checking for $word
  318.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  319.   for dir in $PATH; do
  320.     test -z "$dir" && dir=.
  321.     if test -f $dir/$word; then
  322.       tk_ok="1"
  323.       break
  324.     fi
  325.   done
  326.   IFS="$saveifs"
  327. fi
  328. test -z "$tk_ok" && tk_ok="0"
  329. test -n "$tk_ok" && test -n "$verbose" && echo "    setting tk_ok to $tk_ok"
  330.  
  331. if test $tk_ok = 1; then
  332.     # If we find X, set shell vars x_includes and x_libraries to the paths.
  333. no_x=true
  334. echo checking for X include and library files with xmkmf
  335. rm -fr conftestdir
  336. if mkdir conftestdir; then
  337.   cd conftestdir
  338.   cat > Imakefile <<\EOF
  339. acfindx:
  340.     @echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
  341. EOF
  342.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  343.     no_x=
  344.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  345.     eval `make acfindx | grep -v make`
  346.     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
  347.     if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
  348.       im_usrlibdir=$im_libdir
  349.     fi
  350.     case "$im_incroot" in
  351.     /usr/include) ;;
  352.     *) x_includes="$im_incroot" ;;
  353.     esac
  354.     case "$im_usrlibdir" in
  355.     /usr/lib | /lib) ;;
  356.     *) x_libraries="$im_usrlibdir" ;;
  357.     esac
  358.   fi
  359.   cd ..
  360.   rm -fr conftestdir
  361. fi
  362.  
  363. if test -z "$im_usrlibdir"; then
  364. echo checking for X include and library files directly
  365. cat > conftest.c <<EOF
  366. #include "confdefs.h"
  367. #include <X11/Intrinsic.h>
  368. EOF
  369. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  370. if test -z "$err"; then
  371.   rm -rf conftest*
  372.   no_x=
  373.  
  374. else
  375.   rm -rf conftest*
  376.   for dir in \
  377.     /usr/local/include \
  378.     /usr/unsupported/include \
  379.     /usr/x386/include \
  380.     /usr/local/x11r5/include \
  381.     /usr/include/X11R5 \
  382.     /usr/include/X11R4 \
  383.     /usr/X11R5/include \
  384.     /usr/X11/include \
  385.     /usr/openwin/include \
  386.     /usr/openwin/share/include \
  387.     /usr/lpp/Xamples/include \
  388.     ; \
  389.   do
  390.     if test -r $dir/X11/Intrinsic.h; then
  391.       x_includes=$dir; no_x=
  392.       break
  393.     fi
  394.   done
  395. fi
  396. rm -f conftest*
  397.  
  398. # Check for the libraries.  First see if replacing the `include' by
  399. # `lib' works.
  400. LIBS_save="${LIBS}"
  401. LIBS="${LIBS} -lXt"
  402. have_lib=""
  403. echo checking for -lXt
  404. cat > conftest.c <<EOF
  405. #include "confdefs.h"
  406.  
  407. int main() { exit(0); }
  408. int t() { main(); }
  409. EOF
  410. if eval $compile; then
  411.   rm -rf conftest*
  412.   have_lib="1"
  413.  
  414. fi
  415. rm -f conftest*
  416. LIBS="${LIBS_save}"
  417. if test -n "${have_lib}"; then
  418.    :; no_x=
  419. else
  420.    :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  421.   /usr/local/lib \
  422.   /usr/unsupported/lib \
  423.   /usr/x386/lib \
  424.   /usr/local/x11r5/lib \
  425.   /usr/lib/X11 \
  426.   /usr/lib/X11R4 \
  427.   /usr/X11R5/lib \
  428.   /usr/X11/lib \
  429.   /usr/openwin/lib \
  430.   /usr/lpp/Xamples/lib \
  431.   ; \
  432. do
  433.   for extension in a so sl; do
  434.     if test -r $dir/libXt.$extension; then
  435.       x_libraries=$dir; no_x=
  436.       break 2
  437.     fi
  438.   done
  439. done
  440. fi
  441.  
  442. fi
  443. if test -n "$verbose"; then
  444.   test -n "$x_includes" && echo "    found X11 headers in $x_includes"
  445.   test -n "$x_libraries" && echo "    found X11 libraries in $x_libraries"
  446. fi
  447. fi
  448. if test "$x_includes" = /usr/include; then
  449.     XINCLUDES="# no special path needed"
  450. elif test "$x_includes" != ""; then
  451.     XINCLUDES=" -I$x_includes"
  452. else
  453.     echo checking for X11 header files
  454.     XINCLUDES="# no special path needed"
  455.     cat > conftest.c <<EOF
  456. #include "confdefs.h"
  457. #include <X11/Intrinsic.h>
  458. EOF
  459. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  460. if test -z "$err"; then
  461.   :
  462. else
  463.   rm -rf conftest*
  464.   XINCLUDES="nope"
  465. fi
  466. rm -f conftest*
  467.     if test "$XINCLUDES" = nope; then
  468.         dirs=${XINCLUDE_DIR-"/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include"}
  469.         for i in $dirs ; do
  470.         if test -r $i/X11/Intrinsic.h; then
  471.             XINCLUDES=" -I$i"
  472.         fi
  473.         done
  474.     fi
  475. fi
  476. if test "$XINCLUDES" = nope; then
  477.   echo "Warning:  couldn't find any X11 include files."
  478.   XINCLUDES="# no include files found"
  479. fi
  480.  
  481.  
  482. if test "$x_libraries" = /usr/lib; then
  483.     XLIBSW=-lX11
  484. elif test "$x_libraries" != ""; then
  485.     XLIBSW="-L$x_libraries -lX11"
  486. else
  487.     echo "checking for X11 library archive"
  488.     LIBS_save="${LIBS}"
  489. LIBS="${LIBS} -lX11"
  490. have_lib=""
  491. echo checking for -lX11
  492. cat > conftest.c <<EOF
  493. #include "confdefs.h"
  494.  
  495. int main() { exit(0); }
  496. int t() { main(); }
  497. EOF
  498. if eval $compile; then
  499.   rm -rf conftest*
  500.   have_lib="1"
  501.  
  502. fi
  503. rm -f conftest*
  504. LIBS="${LIBS_save}"
  505. if test -n "${have_lib}"; then
  506.    :; XLIBSW="-lX11"
  507. else
  508.    :; XLIBSW=nope
  509. fi
  510.  
  511.     if test "$XLIBSW" = nope; then
  512.     dirs=${XLIBRARY_DIR-"/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib"}
  513.     for i in $dirs ; do
  514.         if test -r $i/libX11.a; then
  515.         XLIBSW="-L$i -lX11"
  516.         fi
  517.     done
  518.     fi
  519. fi
  520. if test "$XLIBSW" = nope ; then
  521.     LIBS_save="${LIBS}"
  522. LIBS="${LIBS} -lXwindow"
  523. have_lib=""
  524. echo checking for -lXwindow
  525. cat > conftest.c <<EOF
  526. #include "confdefs.h"
  527.  
  528. int main() { exit(0); }
  529. int t() { main(); }
  530. EOF
  531. if eval $compile; then
  532.   rm -rf conftest*
  533.   have_lib="1"
  534.  
  535. fi
  536. rm -f conftest*
  537. LIBS="${LIBS_save}"
  538. if test -n "${have_lib}"; then
  539.    :; XLIBSW=-lXwindow
  540. else
  541.    :; 
  542. fi
  543.  
  544. fi
  545. if test "$XLIBSW" = nope ; then
  546.     echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
  547.     XLIBSW=-lX11
  548. fi
  549.  
  550.  
  551. #--------------------------------------------------------------------
  552. #    Check for the existence of various libraries.  The order here
  553. #    is important, so that then end up in the right order in the
  554. #    command line generated by Make.
  555. #--------------------------------------------------------------------
  556. LIBS_save="${LIBS}"
  557. LIBS="${LIBS} -lm"
  558. have_lib=""
  559. echo checking for -lm
  560. cat > conftest.c <<EOF
  561. #include "confdefs.h"
  562.  
  563. int main() { exit(0); }
  564. int t() { main(); }
  565. EOF
  566. if eval $compile; then
  567.   rm -rf conftest*
  568.   have_lib="1"
  569.  
  570. fi
  571. rm -f conftest*
  572. LIBS="${LIBS_save}"
  573. if test -n "${have_lib}"; then
  574.    :; LIBS="$LIBS -lm"
  575. else
  576.    :; 
  577. fi
  578.  
  579.  
  580. #--------------------------------------------------------------------
  581. # Make some guesses where the Tcl/Tk include files and libraries are.
  582. #--------------------------------------------------------------------
  583. PWD=`pwd`
  584.  
  585. echo checking for tcl.h
  586. cat > conftest.c <<EOF
  587. #include "confdefs.h"
  588. #include <tcl.h>
  589. EOF
  590. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  591. if test -z "$err"; then
  592.   :
  593. else
  594.   rm -rf conftest*
  595.   
  596. if test -f $PWD/../../../tcl/tcl-7.0/tclInt.h ; then
  597.   TCL_INCDIR=$PWD/../../../tcl/tcl-7.0
  598. elif test -f $PWD/../tcl7.0/tclInt.h ; then
  599.   TCL_INCDIR=$PWD/../tcl7.0
  600. elif test -f $PWD/../tcl7.0b3/tclInt.h ; then
  601.   TCL_INCDIR=$PWD/../tcl7.0b3
  602. elif test -f $x_includes/tk/tclInt.h ; then
  603.   TCL_INCDIR=$x_includes/tk
  604. elif test -f /usr/local/include/tclInt.h ; then
  605.   TCL_INCDIR=/usr/local/include
  606. else
  607.   echo "What directory contains Tcl source code (absolute path) ?"
  608.   read TCL_INCDIR
  609. fi
  610. echo "setting TCL_INCDIR as $TCL_INCDIR"
  611.  
  612.  
  613. fi
  614. rm -f conftest*
  615.  
  616.  
  617. TCL_LIBDIR=unknown
  618. if test -f $PWD/../../../tcl/tcl7.0/libtcl.a ; then
  619.   TCL_LIBDIR=$PWD/../../../tcl/tcl7.0
  620. elif test -f $PWD/../tcl7.0/libtcl.a ; then
  621.   TCL_LIBDIR=$PWD/../tcl7.0
  622. elif test -f $PWD/../tcl7.0b3/libtcl.a ; then
  623.   TCL_LIBDIR=$PWD/../tcl7.0b3
  624. elif test -f $x_libraries/libtcl.a ; then
  625.   TCL_LIBDIR=$x_libraries
  626. elif test -f /usr/local/lib/libtcl.a ; then
  627.   TCL_LIBDIR=/usr/local/lib
  628. else
  629.   echo "What directory contains libtcl.a ?"
  630.   read TCL_LIBDIR
  631. fi
  632. echo "setting TCL_LIBDIR as $TCL_LIBDIR"
  633.  
  634.  
  635. echo checking for tk.h
  636. cat > conftest.c <<EOF
  637. #include "confdefs.h"
  638. #include <tk.h>
  639. EOF
  640. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  641. if test -z "$err"; then
  642.   :
  643. else
  644.   rm -rf conftest*
  645.   
  646. if test -f $PWD/../../../tk/tk-3.3/tk.h ; then
  647.   TK_INCDIR=$PWD/../../../tk/tk-3.3
  648. elif test -f $PWD/../tk3.3/tk.h ; then
  649.   TK_INCDIR=$PWD/../tk3.3
  650. elif test -f $PWD/../tk3.3b3/tk.h ; then
  651.   TK_INCDIR=$PWD/../tk3.3b3
  652. elif test -f $x_includes/tk/tk.h ; then
  653.   TK_INCDIR=$x_includes/tk
  654. elif test -f /usr/local/include/tk.h ; then
  655.   TK_INCDIR=/usr/local/include
  656. else
  657.   echo "What directory contains tk.h (absolute path) ?"
  658.   read TK_INCDIR
  659. fi
  660. echo "setting TK_INCDIR as $TK_INCDIR"
  661.  
  662.  
  663. fi
  664. rm -f conftest*
  665.  
  666.  
  667. TK_LIBDIR=unknown
  668. if test -f $PWD/../../../tk/tk3.3/libtk.a ; then
  669.   TK_LIBDIR=$PWD/../../../tk/tk3.3
  670. elif test -f $PWD/../tk3.3/libtk.a ; then
  671.   TK_LIBDIR=$PWD/../tk3.3
  672. elif test -f $PWD/../tk3.3b3/libtk.a ; then
  673.   TK_LIBDIR=$PWD/../tk3.3b3
  674. elif test -f $x_libraries/libtk.a ; then
  675.   TK_LIBDIR=$x_libraries
  676. elif test -f /usr/local/lib/libtk.a ; then
  677.   TK_LIBDIR=/usr/local/lib
  678. else
  679.   echo "What directory contains libtk.a ?"
  680.   read TK_LIBDIR
  681. fi
  682. echo "setting TK_LIBDIR as $TK_LIBDIR"
  683.  
  684.  
  685. #--------------------------------------------------------------------
  686. # Check to see if compiler will handle "-pic" for shared libraries
  687. #--------------------------------------------------------------------
  688. CFLAGS_save=$CFLAGS
  689. CFLAGS="$CFLAGS -pic"
  690. echo checking for "shared library support"
  691. cat > conftest.c <<EOF
  692. #include "confdefs.h"
  693.  
  694. int main() { exit(0); }
  695. int t() { 
  696.     int i; double d;
  697.     for (i=0; i<10; i++) d=2*i;
  698.  }
  699. EOF
  700. if eval $compile; then
  701.   rm -rf conftest*
  702.   can_do_shared_libs=1
  703.  
  704. else
  705.   rm -rf conftest*
  706.   can_do_shared_libs=0
  707. fi
  708. rm -f conftest*
  709.  
  710. CFLAGS=$CFLAGS_save
  711.  
  712. if eval "ld -assert pure-text >/dev/null 2>&1"; then
  713.     can_do_shared_libs=$can_do_shared_libs
  714. else
  715.     can_do_shared_libs=0
  716. fi
  717.  
  718. if test $can_do_shared_libs = 1; then
  719.     SHARED='libitcl.so.$(VERSION)'
  720. else
  721.     SHARED=''
  722.     echo "== DON'T KNOW HOW TO DO SHARED LIBRARIES ON THIS MACHINE =="
  723. fi
  724.  
  725.  
  726. # Set default prefixes.
  727. if test -n "$prefix"; then
  728.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  729.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  730. fi
  731. if test -n "$exec_prefix"; then
  732.   prsub="$prsub
  733. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  734. fi
  735. # Quote sed substitution magic chars in DEFS.
  736. cat >conftest.def <<EOF
  737. $DEFS
  738. EOF
  739. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  740. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  741. rm -f conftest.def
  742. # Substitute for predefined variables.
  743.  
  744. trap 'rm -f config.status; exit 1' 1 3 15
  745. echo creating config.status
  746. rm -f config.status
  747. cat > config.status <<EOF
  748. #!/bin/sh
  749. # Generated automatically by configure.
  750. # Run this file to recreate the current configuration.
  751. # This directory was configured as follows,
  752. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  753. #
  754. # $0 $configure_args
  755.  
  756. for arg
  757. do
  758.   case "\$arg" in
  759.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  760.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  761.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  762.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  763.   esac
  764. done
  765.  
  766. trap 'rm -f Makefile src/Makefile man/Makefile; exit 1' 1 3 15
  767. INSTALL='$INSTALL'
  768. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  769. INSTALL_DATA='$INSTALL_DATA'
  770. RANLIB='$RANLIB'
  771. CPP='$CPP'
  772. CC='$CC'
  773. tk_ok='$tk_ok'
  774. XINCLUDES='$XINCLUDES'
  775. XLIBSW='$XLIBSW'
  776. TCL_INCDIR='$TCL_INCDIR'
  777. TCL_LIBDIR='$TCL_LIBDIR'
  778. TK_INCDIR='$TK_INCDIR'
  779. TK_LIBDIR='$TK_LIBDIR'
  780. SHARED='$SHARED'
  781. LIBS='$LIBS'
  782. srcdir='$srcdir'
  783. DEFS='$DEFS'
  784. prefix='$prefix'
  785. exec_prefix='$exec_prefix'
  786. prsub='$prsub'
  787. extrasub='$extrasub'
  788. EOF
  789. cat >> config.status <<\EOF
  790.  
  791. top_srcdir=$srcdir
  792.  
  793. CONFIG_FILES=${CONFIG_FILES-"Makefile src/Makefile man/Makefile"}
  794. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  795.   srcdir=$top_srcdir
  796.   # Remove last slash and all that follows it.  Not all systems have dirname.
  797.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  798.   if test "$dir" != "$file"; then
  799.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  800.     test ! -d $dir && mkdir $dir
  801.   fi
  802.   echo creating $file
  803.   rm -f $file
  804.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  805.   sed -e "
  806. $prsub
  807. $extrasub
  808. s%@INSTALL@%$INSTALL%g
  809. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  810. s%@INSTALL_DATA@%$INSTALL_DATA%g
  811. s%@RANLIB@%$RANLIB%g
  812. s%@CPP@%$CPP%g
  813. s%@CC@%$CC%g
  814. s%@tk_ok@%$tk_ok%g
  815. s%@XINCLUDES@%$XINCLUDES%g
  816. s%@XLIBSW@%$XLIBSW%g
  817. s%@TCL_INCDIR@%$TCL_INCDIR%g
  818. s%@TCL_LIBDIR@%$TCL_LIBDIR%g
  819. s%@TK_INCDIR@%$TK_INCDIR%g
  820. s%@TK_LIBDIR@%$TK_LIBDIR%g
  821. s%@SHARED@%$SHARED%g
  822. s%@LIBS@%$LIBS%g
  823. s%@srcdir@%$srcdir%g
  824. s%@DEFS@%$DEFS%
  825. " $top_srcdir/${file}.in >> $file
  826. fi; done
  827.  
  828.  
  829. exit 0
  830. EOF
  831. chmod +x config.status
  832. ${CONFIG_SHELL-/bin/sh} config.status
  833.  
  834.